<template>
  <view class="order-container">
    <view class="tab-bar">
      <view 
        v-for="(tab, index) in tabs" 
        :key="index"
        :class="['tab-item', currentTab === tab.type ? 'active' : '']"
        @click="switchTab(tab.type)"
      >
        {{ tab.name }}
      </view>
    </view>
    
    <view class="order-list">
      <view class="empty-tip" v-if="orderList.length === 0">
        暂无相关订单
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      currentTab: 'all',
      tabs: [
        { name: '全部', type: 'all' },
        { name: '待付款', type: 'pending' },
        { name: '待收货', type: 'delivery' },
        { name: '退款/售后', type: 'refund' }
      ],
      orderList: []
    }
  },
  onLoad(options) {
    if(options.type) {
      this.currentTab = options.type
    }
  },
  methods: {
    switchTab(type) {
      this.currentTab = type
      // 这里可以根据type加载不同类型的订单数据
    }
  }
}
</script>

<style lang="scss">
.order-container {
  min-height: 100vh;
  background: #f5f5f5;
  
  .tab-bar {
    display: flex;
    background: #fff;
    padding: 20rpx 0;
    
    .tab-item {
      flex: 1;
      text-align: center;
      font-size: 28rpx;
      color: #333;
      position: relative;
      
      &.active {
        color: #ff4444;
        
        &:after {
          content: '';
          position: absolute;
          bottom: -20rpx;
          left: 50%;
          transform: translateX(-50%);
          width: 40rpx;
          height: 4rpx;
          background: #ff4444;
        }
      }
    }
  }
  
  .empty-tip {
    text-align: center;
    color: #999;
    padding: 100rpx 0;
  }
}
</style> 